#!/usr/bin/env node

//console.log(process.argv);//只有0和1下标

//如果添加了内容，就是2下标开始
//console.log(process.argv[2],process.argv[3]);

const exp = process.argv[2];

/* if(typeof(arg) === 'undefined' ||
      arg === '--help'||
      arg === '-h'){
        help();
      }else{
        calc();
      }
function help(){
  console.log('\
      usage: cmd-name [OPTION] [expression]\n\
      evaluate the expression.\n\
      \n\
      Mandatory arguments to long options are mandatory for short options too.\n\
      -h, --help output help information and exit');
}*/
/*function cala(){
  try{
    console.log(`${arg} = ${eval(arg)}`);
  }catch(e){
    console.log(`${arg} err!`);
  }
}*/
console.log(`${exp}=${eval(exp)}`);
//console.log('hello','world');
